/**
 * @author: wq
 * @Date: 2017/5/15
 * @Time: 17:17
 * <p>
 * Description:
 *          ***
 */
import axios from 'axios';
import {API_NEW_VERSION} from '../api';

const ORDERS_RECEPTIONS = API_NEW_VERSION + 'orders/reception';
const ORDERS_RECEPTION_ORDER_ID = API_NEW_VERSION + 'orders/reception/order_id';
const ORDERS_RECEPTION_ORDER_TABLE = API_NEW_VERSION + 'orders/reception/order_table';

/**
 * 获取接待录入列表
 *          不分页
 * @param params
 * @returns {AxiosPromise}
 */
export const getOrderReceptions = params => {
  return axios.get(ORDERS_RECEPTIONS, {params: params});
};

/**
 * 新增接待录入
 * @param params
 * @returns {AxiosPromise}
 */
export const saveOrderReceptions = params => {
  return axios.post(ORDERS_RECEPTIONS, params);
};

/**
 * 根据订单id获取订单录入列表信息
 * @param orderId
 * @returns {AxiosPromise}
 */
export const getOrderReceptionsByOrderId = params => {
  return axios.get(ORDERS_RECEPTION_ORDER_ID, {params: params});
};

export const getOrderReceptionsByOrderIdTable = params => {
  return axios.get(ORDERS_RECEPTION_ORDER_TABLE, {params: params});
};

export const receptionTypeStatistics = params => {
  return axios.get(API_NEW_VERSION + 'orders_reception_reception_type_statistics', {params: params});
};
